package com.thread;

public class GetThread implements Runnable{
    Student student;

    public GetThread(Student student) {
        this.student = student;
    }


    public void run() {
/*        while (true)
        {
            synchronized (student)
            {
                if (student.isFlag()==false)
                {
                    try {
                        student.wait();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                System.out.println(Thread.currentThread().getName()+"--"+this.student.getName()+":"+this.student.getAge());
                student.setFlag(false);
                student.notify();
            }
        }*/
        while (true)
        {
            student.GetStudent();

        }
    }
}
